Integrand size = 21, antiderivative size = 102 \[ \int \frac {(c+d x)^2}{a-a \cos (e+f x)} \, dx=-\frac {i (c+d x)^2}{a f}-\frac {(c+d x)^2 \cot \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}+\frac {4 d (c+d x) \log \left (1-e^{i (e+f x)}\right )}{a f^2}-\frac {4 i d^2 \operatorname {PolyLog}\left (2,e^{i (e+f x)}\right )}{a f^3} \]
[Out]
Time = 0.22 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3399, 4269, 3798, 2221, 2317, 2438} \[ \int \frac {(c+d x)^2}{a-a \cos (e+f x)} \, dx=\frac {4 d (c+d x) \log \left (1-e^{i (e+f x)}\right )}{a f^2}-\frac {(c+d x)^2 \cot \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}-\frac {i (c+d x)^2}{a f}-\frac {4 i d^2 \operatorname {PolyLog}\left (2,e^{i (e+f x)}\right )}{a f^3} \]
[In]
[Out]
Rule 2221
Rule 2317
Rule 2438
Rule 3399
Rule 3798
Rule 4269
Rubi steps \begin{align*} \text {integral}& = \frac {\int (c+d x)^2 \csc ^2\left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{2 a} \\ & = -\frac {(c+d x)^2 \cot \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}+\frac {(2 d) \int (c+d x) \cot \left (\frac {e}{2}+\frac {f x}{2}\right ) \, dx}{a f} \\ & = -\frac {i (c+d x)^2}{a f}-\frac {(c+d x)^2 \cot \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}-\frac {(4 i d) \int \frac {e^{2 i \left (\frac {e}{2}+\frac {f x}{2}\right )} (c+d x)}{1-e^{2 i \left (\frac {e}{2}+\frac {f x}{2}\right )}} \, dx}{a f} \\ & = -\frac {i (c+d x)^2}{a f}-\frac {(c+d x)^2 \cot \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}+\frac {4 d (c+d x) \log \left (1-e^{i (e+f x)}\right )}{a f^2}-\frac {\left (4 d^2\right ) \int \log \left (1-e^{2 i \left (\frac {e}{2}+\frac {f x}{2}\right )}\right ) \, dx}{a f^2} \\ & = -\frac {i (c+d x)^2}{a f}-\frac {(c+d x)^2 \cot \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}+\frac {4 d (c+d x) \log \left (1-e^{i (e+f x)}\right )}{a f^2}+\frac {\left (4 i d^2\right ) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{2 i \left (\frac {e}{2}+\frac {f x}{2}\right )}\right )}{a f^3} \\ & = -\frac {i (c+d x)^2}{a f}-\frac {(c+d x)^2 \cot \left (\frac {e}{2}+\frac {f x}{2}\right )}{a f}+\frac {4 d (c+d x) \log \left (1-e^{i (e+f x)}\right )}{a f^2}-\frac {4 i d^2 \operatorname {PolyLog}\left (2,e^{i (e+f x)}\right )}{a f^3} \\ \end{align*}
Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(292\) vs. \(2(102)=204\).
Time = 6.46 (sec) , antiderivative size = 292, normalized size of antiderivative = 2.86 \[ \int \frac {(c+d x)^2}{a-a \cos (e+f x)} \, dx=\frac {2 \csc \left (\frac {e}{2}\right ) \sin \left (\frac {1}{2} (e+f x)\right ) \left (f^2 (c+d x)^2 \sin \left (\frac {f x}{2}\right )-2 c d f \left (f x \cos \left (\frac {e}{2}\right )-2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sin \left (\frac {e}{2}\right )\right ) \sin \left (\frac {1}{2} (e+f x)\right )+d^2 \left (-e^{i \arctan \left (\tan \left (\frac {e}{2}\right )\right )} f^2 x^2 \cos \left (\frac {e}{2}\right ) \sqrt {\sec ^2\left (\frac {e}{2}\right )}-4 \left (-\frac {1}{2} i f x \left (\pi -2 \arctan \left (\tan \left (\frac {e}{2}\right )\right )\right )-\pi \log \left (1+e^{-i f x}\right )-\left (f x+2 \arctan \left (\tan \left (\frac {e}{2}\right )\right )\right ) \log \left (1-e^{i \left (f x+2 \arctan \left (\tan \left (\frac {e}{2}\right )\right )\right )}\right )+\pi \log \left (\cos \left (\frac {f x}{2}\right )\right )+2 \arctan \left (\tan \left (\frac {e}{2}\right )\right ) \log \left (\sin \left (\frac {f x}{2}+\arctan \left (\tan \left (\frac {e}{2}\right )\right )\right )\right )+i \operatorname {PolyLog}\left (2,e^{i \left (f x+2 \arctan \left (\tan \left (\frac {e}{2}\right )\right )\right )}\right )\right ) \sin \left (\frac {e}{2}\right )\right ) \sin \left (\frac {1}{2} (e+f x)\right )\right )}{f^3 (a-a \cos (e+f x))} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 246 vs. \(2 (92 ) = 184\).
Time = 1.24 (sec) , antiderivative size = 247, normalized size of antiderivative = 2.42
method | result | size |
risch | \(-\frac {2 i \left (x^{2} d^{2}+2 c d x +c^{2}\right )}{f a \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}-\frac {4 d c \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a \,f^{2}}+\frac {4 d c \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{a \,f^{2}}-\frac {2 i d^{2} x^{2}}{a f}-\frac {4 i d^{2} e x}{a \,f^{2}}-\frac {2 i d^{2} e^{2}}{a \,f^{3}}+\frac {4 d^{2} \ln \left (1-{\mathrm e}^{i \left (f x +e \right )}\right ) x}{a \,f^{2}}+\frac {4 d^{2} \ln \left (1-{\mathrm e}^{i \left (f x +e \right )}\right ) e}{a \,f^{3}}-\frac {4 i d^{2} \operatorname {Li}_{2}\left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a \,f^{3}}+\frac {4 d^{2} e \ln \left ({\mathrm e}^{i \left (f x +e \right )}\right )}{a \,f^{3}}-\frac {4 d^{2} e \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right )}{a \,f^{3}}\) | \(247\) |
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 283 vs. \(2 (89) = 178\).
Time = 0.28 (sec) , antiderivative size = 283, normalized size of antiderivative = 2.77 \[ \int \frac {(c+d x)^2}{a-a \cos (e+f x)} \, dx=-\frac {d^{2} f^{2} x^{2} + 2 \, c d f^{2} x + c^{2} f^{2} + 2 i \, d^{2} {\rm Li}_2\left (\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right )\right ) \sin \left (f x + e\right ) - 2 i \, d^{2} {\rm Li}_2\left (\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right )\right ) \sin \left (f x + e\right ) + 2 \, {\left (d^{2} e - c d f\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2} i \, \sin \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) + 2 \, {\left (d^{2} e - c d f\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) - \frac {1}{2} i \, \sin \left (f x + e\right ) + \frac {1}{2}\right ) \sin \left (f x + e\right ) - 2 \, {\left (d^{2} f x + d^{2} e\right )} \log \left (-\cos \left (f x + e\right ) + i \, \sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) - 2 \, {\left (d^{2} f x + d^{2} e\right )} \log \left (-\cos \left (f x + e\right ) - i \, \sin \left (f x + e\right ) + 1\right ) \sin \left (f x + e\right ) + {\left (d^{2} f^{2} x^{2} + 2 \, c d f^{2} x + c^{2} f^{2}\right )} \cos \left (f x + e\right )}{a f^{3} \sin \left (f x + e\right )} \]
[In]
[Out]
\[ \int \frac {(c+d x)^2}{a-a \cos (e+f x)} \, dx=- \frac {\int \frac {c^{2}}{\cos {\left (e + f x \right )} - 1}\, dx + \int \frac {d^{2} x^{2}}{\cos {\left (e + f x \right )} - 1}\, dx + \int \frac {2 c d x}{\cos {\left (e + f x \right )} - 1}\, dx}{a} \]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 310 vs. \(2 (89) = 178\).
Time = 0.39 (sec) , antiderivative size = 310, normalized size of antiderivative = 3.04 \[ \int \frac {(c+d x)^2}{a-a \cos (e+f x)} \, dx=-\frac {2 \, {\left (c^{2} f^{2} - 2 \, {\left (c d f \cos \left (f x + e\right ) + i \, c d f \sin \left (f x + e\right ) - c d f\right )} \arctan \left (\sin \left (f x + e\right ), \cos \left (f x + e\right ) - 1\right ) + 2 \, {\left (d^{2} f x \cos \left (f x + e\right ) + i \, d^{2} f x \sin \left (f x + e\right ) - d^{2} f x\right )} \arctan \left (\sin \left (f x + e\right ), -\cos \left (f x + e\right ) + 1\right ) + {\left (d^{2} f^{2} x^{2} + 2 \, c d f^{2} x\right )} \cos \left (f x + e\right ) + 2 \, {\left (d^{2} \cos \left (f x + e\right ) + i \, d^{2} \sin \left (f x + e\right ) - d^{2}\right )} {\rm Li}_2\left (e^{\left (i \, f x + i \, e\right )}\right ) + {\left (-i \, d^{2} f x - i \, c d f + {\left (i \, d^{2} f x + i \, c d f\right )} \cos \left (f x + e\right ) - {\left (d^{2} f x + c d f\right )} \sin \left (f x + e\right )\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} - 2 \, \cos \left (f x + e\right ) + 1\right ) + {\left (i \, d^{2} f^{2} x^{2} + 2 i \, c d f^{2} x\right )} \sin \left (f x + e\right )\right )}}{-i \, a f^{3} \cos \left (f x + e\right ) + a f^{3} \sin \left (f x + e\right ) + i \, a f^{3}} \]
[In]
[Out]
\[ \int \frac {(c+d x)^2}{a-a \cos (e+f x)} \, dx=\int { -\frac {{\left (d x + c\right )}^{2}}{a \cos \left (f x + e\right ) - a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(c+d x)^2}{a-a \cos (e+f x)} \, dx=\int \frac {{\left (c+d\,x\right )}^2}{a-a\,\cos \left (e+f\,x\right )} \,d x \]
[In]
[Out]